import React, { useEffect, useRef, useState } from "react";
import { Avatar, Button } from "antd-mobile";
import dayjs from "dayjs";
import { AVATAR_URL, BASE_PATH } from "@/config";

const pageName = "rank.item";
const klassName = pageName.replace(/\./g, '-');
const rankImg = {
  1: `${BASE_PATH}/img/game/rank-1.png`,
  2: `${BASE_PATH}/img/game/rank-2.png`,
  3: `${BASE_PATH}/img/game/rank-3.png`,
}
export default function RankItem({ self, isColumns, item }) {
  console.log('xxxxxxxx', item)
  return (
    <div className={`cp-${klassName} ${self && `self`}`}>
      <div className="inner">
        <div className="rank">

          {
            item?.rank === 0 ? `无排名` : rankImg[item?.rank] ? <img width={23} src={rankImg[item.rank]} /> : item?.rank
          }
        </div>
        <div className="profile">
          <Avatar src={item?.avatar} />

          <div className="name">
            {item?.nickname}
          </div>
        </div>

        <div className="value">
          {item?.score}分
        </div>
      </div>
    </div>
  )
}

